// 利用filter
let arr= [1,2,3,4,5,2,1,3]
// let newArr =  arr.filter((item,index)=>{
//   return arr.indexOf(item) == index
// })
let newArr=[...new Set(arr)]


let arr1 = [1,2,2,3,3,4,4,4,5,5,5,5,5,54,]



let set = function (params) {
    let newArr = []
    params.forEach(item => {
      if(newArr.indexOf(item) == -1){
        newArr.push(item)
      }
    });
    return newArr
}



let ary = arr1.filter((item,index)=>{
  return arr1.indexOf(item) == index
})

console.log(ary);
